package com.qupeng.demo.kafka.kafkaspringbootstreams.common.kafka.streams;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.streams.processor.TimestampExtractor;
 
public class MyTimestampExtractor implements TimestampExtractor {

    @Override
    public long extract(ConsumerRecord<Object, Object> record, long partitionTime) {
        return parseCreationTimeFromMessage(record);
    }
 
    private long parseCreationTimeFromMessage(ConsumerRecord<Object, Object> record) {
        return record.timestamp();
    }
}